package cn.atzxc.qy.mapper;

import cn.atzxc.qy.domain.Address;
import cn.atzxc.qy.domain.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AddressMapper extends BaseMapper<Address> {
    /**
     * 设置默认
     * 根据传递进来的地址ID，将其 is_default字段设置为1，表示默认
     * @param addressId
     * @param isDefault
     * @return
     */
    int updateIsDefaultByAddress(@Param("addressId") long addressId, @Param("isDefault") long isDefault);

    List<Address> selectAddressList();
}
